package com.liwei.classloadersample;

import java.net.URL;

public class LoaderSample2 {
	public static void main(String[] args) {
		System.out.println(ClassLoader
				.getSystemResource("java/lang/String.class"));
		System.out.println("\r\n");

		URL[] urls = sun.misc.Launcher.getBootstrapClassPath().getURLs();
		for (URL u : urls) {
			System.out.println(u);

		}
		System.out.println("\r\n");

		System.out.println("java.class.path\t"
				+ System.getProperty("java.class.path"));
		System.out.println("----------------");
		System.out.println("java.ext.dirs\t"
				+ System.getProperty("java.ext.dirs"));
		System.out.println("----------------");

		ClassLoader extensionClassloader = ClassLoader.getSystemClassLoader()
				.getParent();
		System.out.println("the parent of extension classloader : "
				+ extensionClassloader.getParent());
		System.out.println("----------------");
		System.out.println(System.class.getClassLoader());
		System.out.println("the Launcher's classloader is "
				+ sun.misc.Launcher.getLauncher().getClass().getClassLoader());

	}
}
